package com.chenfeng.ego.portal.service.impl;
import javax.annotation.Resource;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import com.chenfeng.ego.commons.util.HttpClientUtil;
import com.chenfeng.ego.portal.dao.JedisDao;
import com.chenfeng.ego.portal.service.HttpClientService;
@Service
public class HttpClientServiceImpl implements HttpClientService
{
	@Value("${url}")
	private String uri;
	@Value("${picKey}")
	private String pickey;
	@Resource
	JedisDao dao;
	//大广告位
	@Override
	public String showBigPic()
	{       
		if(dao.exists(pickey))
		{
			System.out.println("执行了缓存");
			return dao.get(pickey);
		}else
		{
			String result = HttpClientUtil.doPost(uri); 
			dao.set(pickey, result);
			return result;
		}	
	}
}